package cn.micro.system.manage.controller;

import cn.micro.system.manage.common.captcha.EasyCaptchaProducer;
import cn.micro.system.manage.common.captcha.EasyCaptchaService;
import cn.micro.system.manage.common.result.Result;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/manage/index")
@RequiredArgsConstructor
@Validated
public class IndexController {

    private final EasyCaptchaService easyCaptchaService;

    @GetMapping("getCode")
    public Object getCode(){
        return Result.success(easyCaptchaService.getCaptcha());
    }


}
